﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using hsgsSHXX.Web.Common;
namespace hsgsSHXX.Controllers
{
    /// <summary>
    /// 系统后台首页
    /// </summary>
     [OutputCache(Duration = 0, VaryByParam = "none")]
    public class IndexController : BaseController
    {

        public ActionResult Index()
        {
            if (!string.IsNullOrEmpty(OperateSession.get("LoginId")))
            {
                return View();
            }
            else
            {
                return null;
            }
        }

        public ActionResult Top()
        {
            string loginName = OperateSession.get("UserName");
            ViewData["loginName"] = loginName;

            return View();
        }

        /// <summary>
        /// 左边树形菜单
        /// </summary>
        /// <returns></returns>
        public ActionResult Left()
        {
            ViewData["LoginId"] = OperateSession.get("LoginId") == null ? "" : OperateSession.get("LoginId");
            return View();
        }


        public ActionResult Buttom()
        {
            return View();
        }
        public ActionResult Split()
        {
            return View();
        }

        public ActionResult Content()
        {
            return View();
        }
        /// <summary>
        /// 注销
        /// </summary>
        public void Logout()
        {
            OperateSession.del("UserName");
            OperateSession.del("LoginID");
            Response.Write("<script>window.top.location.replace('/Login')</script>");
            Response.Flush();
            Response.End();
        }
        /// <summary>
        /// 退出
        /// </summary>
        public void LogExit()
        {
            OperateSession.del("UserName");
            OperateSession.del("LoginID");
            Response.Write("<script>window.top.close()</script>");
            Response.Flush();
            Response.End();
        }

    }
}
